Skip to content

Add a clear search and filters action to the empty state#48

Merged
mberman84 merged 1 commit into
Forward-Future:mainfrom
HMAKT99:feat/clear-filters-empty-state
Jun 22, 2026
Merged

Add a clear search and filters action to the empty state#48
mberman84 merged 1 commit into
Forward-Future:mainfrom
HMAKT99:feat/clear-filters-empty-state

Conversation

@HMAKT99

@HMAKT99 HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Summary

When a search query or category filter matches no loops, the empty state reads:

Try another category, broaden your search, or submit the workflow.

…but offers no direct way to actually do that. The only ways back to the full catalog are manually clearing the search box or hunting for the All category chip — extra friction at exactly the dead-end moment.

This adds a Clear search & filters button to the empty state that:

  • clears the search input,
  • resets the active category to All (updating the chip is-active / aria-pressed state),
  • resets pagination to page 1 and re-renders the full catalog, and
  • returns focus to the search box so keyboard users can immediately type a new query.

Changes

  • site/index.html — wrap the empty-state actions and add the reset button.
  • site/script.js — wire the button to reset query + category and refocus search.
  • site/styles.css — style the button to match the existing pagination/control buttons (including :focus-visible).

Verification

  • node scripts/check.mjsLoop Library checks passed.
  • node --check site/script.js
  • Builders (build-skill-catalog, build-loop-pages, build-social-images) → no artifact drift.

@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Small UX follow-on: when a search or filter returns nothing, the empty state asks people to "broaden your search" but doesn't give them a way to do it. This adds a Clear search & filters button that resets to the default view and returns focus to the search box.

I matched the existing pagination/control button styling (including :focus-visible) so it should feel native. Full check suite + builders pass with no artifact drift. No worries if you'd rather style it differently — easy to adjust.

@mberman84 mberman84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reset behavior is correct in browser verification: it clears the query/category/page, restores the All chip's ARIA state, hides the empty state, and returns focus to search.

One deployment blocker remains: this changes both site/script.js and site/styles.css while pages still request the existing ?v=20260620-newest-first URLs. Cached visitors can receive the new button markup with old JavaScript/CSS, leaving the action inert or unstyled. Please bump the shared asset version across the homepage, Learn/Agents pages, generated loop pages, the page generator, and scripts/check.mjs, then regenerate affected pages.

@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

Bumped both shared asset versions (script.js and styles.css) to 20260621-empty-state across the homepage, Learn/Agents pages, the loop-page generator, and scripts/check.mjs, then regenerated the loop pages — so cached visitors can't get the new button markup with stale JS/CSS. Check suite + builders green.

@HMAKT99

HMAKT99 commented Jun 21, 2026

Copy link
Copy Markdown
Contributor Author

@mberman84 ready for re-review when convenient — both script.js and styles.css versions are bumped and pages regenerated. Thanks!

@mberman84 mberman84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by the corrected review immediately below.

@mberman84 mberman84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correction to my immediately preceding review, whose inline code formatting was stripped by the shell:

The previously requested script/CSS cache-bust is addressed, and the exact head passes node scripts/check.mjs, syntax checks, and all builders. The clear-filters behavior itself remains sound.

This branch now needs a rebase onto current main before it can be approved. Since this PR branched, #61/#62 moved loop detail pages to the database-backed proxy and removed scripts/build-loop-pages.mjs plus site/loops/**. GitHub reports this head as conflicting, and the stale generated-page edits must not restore files intentionally removed by the new architecture.

Please rebase onto the latest main, preserve the focused homepage markup/JS/CSS change, update only the surviving shared asset references/check assertions with a fresh version, and keep the removed generator/static loop pages deleted. Then rerun node scripts/check.mjs and the asset checks.

@mberman84 mberman84 force-pushed the feat/clear-filters-empty-state branch from 8a754b5 to 9a5d710 Compare June 22, 2026 18:17

@mberman84 mberman84 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rebased onto the database-backed main architecture. The focused empty-state reset markup, behavior, and styling are preserved; stale generated-page artifacts are gone; and the full current CI-equivalent suite passes locally (41/41 Worker tests).

@mberman84 mberman84 merged commit 1dd6274 into Forward-Future:main Jun 22, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants